<template>
  <div class="home">
    <!-- 导航栏 -->
    <Nav />

    <!-- 内容区域 -->
    <div>
      <!-- Banner区域 -->
      <HomeBanner />

      <!-- 数据统计 -->
      <DataStatistics :statistics="dataHeight" />

      <!-- 版权服务 -->
      <CopyrightServices />

      <!-- 版权登记 -->
      <CopyrightEvidence />

      <!-- 版权市场 -->
      <CopyrightRegistration />

      <!-- 芝麻AI -->
      <CopyrightMonitoring />

      <!-- 资讯动态 -->
      <NewsSection 
        :policy-news="newlist"
        :platform-news="newlisttwo"
        @view-detail="getDetail"
        @view-more="xwzx"
      />

      <!-- 合作伙伴 -->
      <PartnerSection />
    </div>

    <!-- 页脚 -->
    <Footer />
  </div>
</template>

<script>
import { defineComponent } from 'vue'
import Nav from '@/components/Nav.vue'
import HomeBanner from '@/components/home/HomeBanner.vue'
import DataStatistics from '@/components/home/DataStatistics.vue'
import CopyrightServices from '@/components/home/CopyrightServices.vue'
import CopyrightEvidence from '@/components/home/CopyrightEvidence.vue'
import CopyrightRegistration from '@/components/home/CopyrightRegistration.vue'
import CopyrightMonitoring from '@/components/home/CopyrightMonitoring.vue'
import NewsSection from '@/components/home/NewsSection.vue'
import PartnerSection from '@/components/home/PartnerSection.vue'
import Footer from '@/components/Footer.vue'

// import { queryNumConut, queryHotList, queryNewsList } from '@/http/api'

export default defineComponent({
  name: 'Home',
  
  components: {
    Nav,
    HomeBanner,
    DataStatistics,
    CopyrightServices,
    CopyrightEvidence, 
    CopyrightRegistration,
    CopyrightMonitoring,
    NewsSection,
    PartnerSection,
    Footer
  },

  data() {
    return {
      dataHeight: {},
      newlist: [],
      newlisttwo: []
    }
  },

  async created() {
    // await this.getNumCount()
    // await this.getHotWorks()
    // await this.getNews()
  },

  // methods: {
  //   // 获取统计数据
  //   async getNumCount() {
  //     const res = await queryNumConut()
  //     this.dataHeight = res.data
  //   },

  //   // 获取热门作品
  //   async getHotWorks() {
  //     const res = await queryHotList({ fixCount: true })
  //     this.sec3List = res.data.data
  //   },

  //   // 获取新闻资讯
  //   async getNews() {
  //     const [policyNews, platformNews] = await Promise.all([
  //       queryNewsList({ page: 1, categories: 4 }),
  //       queryNewsList({ page: 1, categories: 5 })
  //     ])
      
  //     this.newlist = policyNews.data.splice(0, 3)
  //     this.newlisttwo = platformNews.data.splice(0, 4)
  //   },

  //   // 查看新闻详情
  //   getDetail(itemId) {
  //     const pathHerf = this.$router.resolve({
  //       path: '/aboutUs/newsCenter',
  //       query: { itemId }
  //     })
  //     window.open(pathHerf.href, '_blank')
  //   },

  //   // 查看更多新闻
  //   xwzx() {
  //     this.$router.push('/aboutUs/newsCenter')
  //   }
  // }
})
</script>

<style lang="scss" scoped>
.home {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: #fff;
}
</style>
